package com.crm.dao.mapper.customMapper.returnMoneyManagerCustomMapper;

import com.crm.model.vo.returnMoney.BankFlowWhiteVO;
import com.crm.model.vo.returnMoney.ProductOrderInfoVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.jdbc.SQL;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BankFlowWhiteCustomMapper {

    @SelectProvider(type = BankFlowWhiteCustomMapper.SqlProvider.class, method = "queryWhiteList")
    List<BankFlowWhiteVO> queryWhiteList();


    class SqlProvider {
        public String queryWhiteList(){
            SQL sql = new SQL();
            sql.SELECT("bfwl.id,\n" +
                    "\tbfwl.white_list_name AS whiteListName,\n" +
                    "\tu.user_name AS createPeopleName,\n" +
                    "\tbfwl.create_time AS createTime \n" +
                    "FROM\n" +
                    "\tbank_flow_white_list bfwl\n" +
                    "\tLEFT JOIN tb_user_account u ON bfwl.create_people_id = u.account_id ");
            sql.ORDER_BY("bfwl.create_time desc");
            return sql.toString();
        }
    }

}
